<template>
  <div class="container">
    <outerBox title="内容填写">
    <Editor v-model="content"></Editor>
    </outerBox>
    <el-button type="success" @click="saveResTeachingReflection">保存</el-button>
  </div>
</template>

<script>
  import { saveResTeachingReflection } from '@/api/createResult'
  import outerBox from '@/components/outerBox'
  import Editor from '@/components/Tinymce/index';
  export default {
    name: 'TeachingReflection',
    data(){
      return {
       content:this.list.content
      }
    },
    props:{
    list:{
      type:[Object],
    	default:()=>{
        return {content:''}
      }
      },
    teachingDesignResId:{
      default:'',
    },
    },
    components:{
      Editor,
      outerBox
    },
    watch:{
      ['list.content'](content){
         this.content = content
      }
    },
    methods:{
      saveResTeachingReflection(){
        let {teachingPlanId:teachingDesignId,typeEditTool}  = this.$store.state.uploadLessonPlan
        let {teachingDesignResId} = this
        let {content} =  this.list
        saveResTeachingReflection({teachingDesignId,teachingDesignResId,content,typeEditTool}).then((res)=>{
            this.$message.success('保存成功！')
        })
      }
    }
  }
</script>

<style>

</style>
